package com.dks.mapper;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import com.dks.dto.MyCourseClassDto;
import com.dks.dto.student.StudentClassTableDto;
import com.dks.models.student.StudentClass;
import com.dks.vo.student.StudentTaskVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface StudentClassMapper {

    Integer insert(StudentClass studentClass);

    Integer update(StudentClass studentClass);

    Integer delete(@Param("id") Long id);

    StudentClass select(@Param("id") Long id);

    List<StudentClass> list(@Param("qsClassId") Long qsClassId, @Param("studentId") Long studentId);


    int addTask(StudentClass studentClass);

    List<StudentTaskVo> listTask(@Param("parentId") Long parentId, @Param("qsClassId") Long qsClassId, @Param("studentId") Long studentId, @Param("status") Integer status);

    List<StudentClass> leaveList(@Param("userId") Long userId, @Param("qsClassId") Long qsClassId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    int leave(@Param("id") Long id, @Param("userId") Long userId, @Param("time") LocalDateTime time);


    StudentTaskVo selectTaskById(Long taskId);

    List<StudentClass> seriesList(@Param("seriesId") Long seriesId, @Param("studentId") Long studentId, @Param("appointmentType") String appointmentType, @Param("time") LocalDateTime time);


    List<MyCourseClassDto> myCourseList(Map<String, Object> map);

    MyCourseClassDto myCourseDetail(@Param("studentClassId")Long studentClassId);


    int suspendClass(@Param("id") Long id, @Param("appointmentType") String appointmentType);

    /**
     * 统计：作业-已批改人数
     */
    Integer countTaskCorrectNum(@Param("qsClassId") long qsClassId);

    /**
     * 统计：上课总人数
     */
    Integer countClassAttendNum(@Param("qsClassId") long qsClassId);

    /**
     * 统计：请假人数
     */
    Integer countClassLeaveNum(@Param("qsClassId") long qsClassId);

    int remove(@Param("id") Long id);

    List<StudentClassTableDto> getStudentClassTableDtoList(Map<String, Object> map);

    StudentClassTableDto getStudentClassDetail(Map<String, Object> map);
}
